package com.freeseed.model.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.freeseed.model.entity.NationalDtl;
import com.freeseed.model.mapper.NationalDtlMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Allwayz
 * @since 2020-03-20
 */
@RestController
@RequestMapping("nationals")
public class NationalDtlController {
    @Autowired
    private NationalDtlMapper nationalDtlMapper;

    @GetMapping
    public List<NationalDtl> getNationalDtlList(){
        List<NationalDtl> nationalDtlList = nationalDtlMapper.selectList(new QueryWrapper<>());
        return nationalDtlList;
    }

    @GetMapping("{Id}")
    public NationalDtl getNationalDtlById(@PathVariable int Id) {
        NationalDtl nationalDtl = nationalDtlMapper.selectById(Id);
        return nationalDtl;
    }
}
